import React from 'react'
import { Card,Avatar,Button} from 'antd'
import{history} from 'umi'
const { Meta } = Card;
import {CheckOutlined} from '@ant-design/icons'
import './index.less'
export default class ReserveCard extends React.Component {
    constructor() {
        super()
    }
    componentDidUpdate(nextProps,nextContext){
        console.log(nextProps)
    }
    see = (studentid,registerid) =>{
      history.push({pathname:'/reserve/editreserve',query:{studentid:encodeURI(studentid),registerid:encodeURI(registerid)}})
    }
    render() {
        return (
            <>
                <Card
                className='resever_hover'
    style={{ margin:'20px 5px'}}
    cover={
      <img
        alt="example"
        src="https://img1.baidu.com/it/u=402460836,4057078985&fm=26&fmt=auto&gp=0.jpg"
      />
    }
    actions={[
      <Button onClick={()=>{this.see(this.props.student_id,this.props.register_id)}} type="primary" shape="round" icon={<CheckOutlined />} size={64}>
          为他看病
        </Button>
    ]}
  >
    <Meta
      avatar={<Avatar src={this.props.header_img} />}
      title={this.props.username}
      description={'预约时间：  '+this.props.createdAt.slice(0,10)}
    />
  </Card>
            </>
        )
    }
}